package com.sgj.gulimall.product.dao;

import com.sgj.gulimall.product.entity.CategoryBrandRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 品牌分类关联
 * 
 * @author guojishen
 * @email 1261550408@qq.com
 * @date 2021-06-11 14:21:46
 */
@Mapper
public interface CategoryBrandRelationDao extends BaseMapper<CategoryBrandRelationEntity> {

    @Update("update pms_category_brand_relation set catelog_name = #{name} where catelog_id = #{catId}")
    @Transactional
    void updateCategory(@Param("catId") Long catId, @Param("name") String name);

    /**
     * 查询产品关联信息
     * @param brandIds
     */
    List<CategoryBrandRelationEntity> selectByBrandIds(@Param("brandIds") List<Long> brandIds);
}
